package org.wattdepot.cli;

import static org.junit.Assert.*;
import junit.framework.Assert;
import org.junit.Before;
import org.junit.Test;
/**
 * Tests if the day and timestamp functions of list sensordata work.
 * 
 * @author Aaron Herres
 * 
 */
public class TestSensorData {
  CommandLineInterface cli;

  /**
   * Initialises class for testing.
   */
  @Before
  public void initializeCommandLineInterface() {
    cli = new CommandLineInterface("http://server.wattdepot.org:8182/wattdepot/");
  }
  /**
   * Tests if the timestamp function returns a value for list sensor data.
   * 
   */
  @Test
  public void testSensorDataTimestamp() {
    
     String message = 
       cli.processMainCommand("list sensordata SIM_AES timestamp 2009-11-01T00:00:00.0000");
     System.out.println(message);
     Assert.assertNotNull(message);
     
      
  }
  /**
   * Tests if the day function returns a value for list sensor data.
   * 
   */
  @Test
  public void testSensorDataDay() {
    String message = cli.processMainCommand("list sensordata SIM_AES day 2009-11-01");
    System.out.println(message);
    Assert.assertNotNull(message);
  }

}
